package torrent;

import java.net.DatagramPacket;

/**
 *
 * @author THIEUQUANG
 */
public class broadcastreceiver extends Function implements Runnable {
   
    public void run() {

               
            while( true) {
                try {
                    
                    while (true) {
                        byte[] receivedBuf = new byte[100];
                        DatagramPacket receivedPacket = new DatagramPacket(receivedBuf,
                                receivedBuf.length);
                        utpSocket.receive(receivedPacket);
                        Thread Anapkt= new Thread(new Core(receivedBuf,receivedPacket));
                        Anapkt.start();
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

    }
}